
********************************************************************************************************
*********************************Are Poor People Poorly Heard?********************************************

*Do-file to replicate the analysis

*Julie Sevenans, Awenig Marié, Christian Breunig, Stefaan Walgrave, Karolin Soontjens, Rens Vliegenthart

*contact: julie.sevenans@uantwerpen.be

********************************************************************************************************

use "Sevenans et al._EJPR_Replication data_General PO_Income.dta", clear

*Calculate the absolute distance between a politician's estimation and the preference of the income group
gen Q12b = Q12/100
gen abs_diff = abs(Q12b-agreement_income)*100


*Main paper - Table 2
xtmixed abs_diff i.income_group i.V2 								if sig==1 || _all: R.SID || V3:
xtmixed abs_diff i.income_group##i.soc_ec i.V2 						if sig==1 || _all: R.SID || V3:	
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 || _all: R.SID || V3:
margins, at(soc_ec=(0 1) income_group=(1 2) ) atmeans

*Main paper - Figure 1
set scheme s2mono
mplotoffset,  ///
title("", size(med)) ///
yscale(range(0(5)30)) ylabel(0(5)30) ytitle("Distance (percentage points) between" "politician's estimation and public opinion") ///
xscale(range(-0.5 1.5))  ///
recast(scatter) legend(rows(1) position(6)) ///
graphregion(color(white))

*Main paper - in text - results hold whenever we drop a country from the analysis
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 & V2!=2 || _all: R.SID || V3:
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 & V2!=5 || _all: R.SID || V3:
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 & V2!=6 || _all: R.SID || V3:

*Appendix 4 - Table 4.1
xtmixed abs_diff i.income_group i.V2 								|| _all: R.SID || V3:
xtmixed abs_diff i.income_group##i.soc_ec i.V2 						|| _all: R.SID || V3:	
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	|| _all: R.SID || V3:

*Appendix 11
reshape wide agreement_income abs_diff, i(V3 SID) j(income_group)
merge m:1 SID using "Sevenans et al._EJPR_Three income groups (Appendix 11).dta"
drop if _merge==2
drop _merge

gen mean = (first + middle + third)/3

gen surplus1 = first - mean
gen surplus2 = middle - mean
gen surplus3 = third - mean
gen diff = Q12b - mean

xtmixed diff surplus1 surplus3 i.V2 	if soc_ec==1 || _all: R.SID || V3:
xtmixed diff surplus1 surplus3 i.V2 	if soc_ec==0 || _all: R.SID || V3:


clear

use "Sevenans et al._EJPR_Replication data_General PO_Class.dta", clear

*Calculate the absolute distance between a politician's estimation and the preference of the class group
gen Q12b = Q12/100
gen abs_diff = abs(Q12b-agreement_class)*100

*Appendix 5 - Table 5.1
xtmixed abs_diff i.class_group i.V2 								if sig==1 || _all: R.SID || V3:
xtmixed abs_diff i.class_group##i.soc_ec i.V2 						if sig==1 || _all: R.SID || V3:	
xtmixed abs_diff i.class_group##i.soc_ec LR_CHES sex yofe i.V2 		if sig==1 || _all: R.SID || V3:





